// pages/personal_tailor/personal_tailor.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    zid:"",
    keshiList:["妇科","皮肤科","耳鼻喉科","口腔科","外科","内分泌科","中医科","营养科","全部科室"]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var zid = options.zid;
    if(zid != 'undefined' && zid != undefined)
    {
      that.setData({
        zid:zid
      })
    }
    
    that.getList();
    that.getBase();
    that.getKeshi();
  },
  // 获取服务包基本设置
  getBase:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.fuwu_base",
      success:function(res)
      {
        that.setData({
          base:res.data
        })
      }
    })
  },
  // 获取列表
  getList:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.fuwu",
      data:{
        zid:that.data.zid,
      },
      success:function(res)
      {
        that.setData({
          list:res.data
        })
      }
    })
  },
  getKeshi:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.keshi",
      success:function(res)
      {
        that.setData({
          keshi_arr:res.data
        })
      }
    })
  },
  // 购买服务包
  bindbuy(e){
    var id = e.currentTarget.dataset.id;
    var time_length = e.currentTarget.dataset.time_length;
    var money = e.currentTarget.dataset.money;
    var zid = this.data.zid
    app.util.request({
      'url':"entry/wxapp/follow."
    })
    wx.navigateTo({
      url: '/hyb_yl/huanzhe/pages/patient_pay/patient_pay?id='+id+'&time_length='+time_length+'&money='+money+'&zid='+zid,
    })
  },

  // 查看服务包
  bindchakan(){

  },
  // 科室
  bindkeshi(e){
    var id = e.currentTarget.dataset.id;

  },
})